import {Column} from "typeorm";
import {SupplierType} from "@/typing/supplierType";
import {IsNotEmpty} from "class-validator";
import {BaseSupplierSpecification} from "@/entitys/common/baseSupplierEntity";
import {ShopSupplierSpecificationValidator} from "@/filter/validator/shopSupplierSpecificationValidator";

export class CreateShopSupplierDTO {

    @IsNotEmpty()
    supplierType: SupplierType;

    @IsNotEmpty()
    @Column({comment: '公司名称'})
    companyName: string;

    @Column({comment: '公司简称', nullable: true})
    companyAbbreviation: string;

    @Column({comment: '公司负责人'})
    representative: string;

    @Column({comment: '公司电话', nullable: true})
    phone: string;

    @Column({comment: '公司联系人'})
    contact: string;

    @Column({comment: '公司联系人电话'})
    contactPhone: string;

    @Column({comment: '公司地址', nullable: true})
    address: string;

    @ShopSupplierSpecificationValidator({})
    @Column({comment: '规格类型', type: 'json'})
    specificationList: BaseSupplierSpecification[];
}
